package game;

/**
 *
 * @author Luan Nico
 */
public class MapConstraints {

    public static final int[][] TILE_BORDERS = new int[][]{
        new int[]{5, 0},
        new int[]{4, 0},
        new int[]{5, 0},
        new int[]{4, 0},
        new int[]{4, 3},
        new int[]{14, 0},
        new int[]{4, 3},
        new int[]{2, 2},
        new int[]{5, 0},
        new int[]{4, 0},
        new int[]{5, 0},
        new int[]{4, 0},
        new int[]{4, 3},
        new int[]{14, 0},
        new int[]{4, 3},
        new int[]{2, 2},
        new int[]{4, 2},
        new int[]{3, 0},
        new int[]{4, 2},
        new int[]{3, 0},
        new int[]{14, 3},
        new int[]{13, 3},
        new int[]{14, 3},
        new int[]{12, 3},
        new int[]{4, 2},
        new int[]{3, 0},
        new int[]{4, 2},
        new int[]{3, 0},
        new int[]{2, 1},
        new int[]{11, 3},
        new int[]{2, 1},
        new int[]{1, 2},
        new int[]{5, 0},
        new int[]{4, 0},
        new int[]{5, 0},
        new int[]{4, 0},
        new int[]{4, 3},
        new int[]{14, 0},
        new int[]{4, 3},
        new int[]{2, 2},
        new int[]{5, 0},
        new int[]{4, 0},
        new int[]{5, 0},
        new int[]{4, 0},
        new int[]{4, 3},
        new int[]{14, 0},
        new int[]{4, 3},
        new int[]{2, 2},
        new int[]{4, 2},
        new int[]{3, 0},
        new int[]{4, 2},
        new int[]{3, 0},
        new int[]{14, 3},
        new int[]{13, 3},
        new int[]{14, 3},
        new int[]{12, 3},
        new int[]{4, 2},
        new int[]{3, 0},
        new int[]{4, 2},
        new int[]{3, 0},
        new int[]{2, 1},
        new int[]{11, 3},
        new int[]{2, 1},
        new int[]{1, 2},
        new int[]{4, 1},
        new int[]{14, 1},
        new int[]{4, 1},
        new int[]{14, 1},
        new int[]{3, 1},
        new int[]{13, 0},
        new int[]{3, 1},
        new int[]{11, 0},
        new int[]{4, 1},
        new int[]{14, 1},
        new int[]{4, 1},
        new int[]{14, 1},
        new int[]{3, 1},
        new int[]{13, 0},
        new int[]{3, 1},
        new int[]{11, 0},
        new int[]{14, 2},
        new int[]{13, 1},
        new int[]{14, 2},
        new int[]{13, 1},
        new int[]{13, 2},
        new int[]{10, 0},
        new int[]{13, 2},
        new int[]{9, 0},
        new int[]{14, 2},
        new int[]{13, 1},
        new int[]{14, 2},
        new int[]{13, 1},
        new int[]{12, 2},
        new int[]{9, 3},
        new int[]{12, 2},
        new int[]{7, 2},
        new int[]{4, 1},
        new int[]{14, 1},
        new int[]{4, 1},
        new int[]{14, 1},
        new int[]{3, 1},
        new int[]{13, 0},
        new int[]{3, 1},
        new int[]{11, 0},
        new int[]{4, 1},
        new int[]{14, 1},
        new int[]{4, 1},
        new int[]{14, 1},
        new int[]{3, 1},
        new int[]{13, 0},
        new int[]{3, 1},
        new int[]{11, 0},
        new int[]{2, 0},
        new int[]{12, 1},
        new int[]{2, 0},
        new int[]{12, 1},
        new int[]{11, 2},
        new int[]{9, 2},
        new int[]{11, 2},
        new int[]{8, 0},
        new int[]{2, 0},
        new int[]{12, 1},
        new int[]{2, 0},
        new int[]{12, 1},
        new int[]{1, 1},
        new int[]{7, 1},
        new int[]{1, 1},
        new int[]{6, 2},
        new int[]{5, 0},
        new int[]{4, 0},
        new int[]{5, 0},
        new int[]{4, 0},
        new int[]{4, 3},
        new int[]{14, 0},
        new int[]{4, 3},
        new int[]{2, 2},
        new int[]{5, 0},
        new int[]{4, 0},
        new int[]{5, 0},
        new int[]{4, 0},
        new int[]{4, 3},
        new int[]{14, 0},
        new int[]{4, 3},
        new int[]{2, 2},
        new int[]{4, 2},
        new int[]{3, 0},
        new int[]{4, 2},
        new int[]{3, 0},
        new int[]{14, 3},
        new int[]{13, 3},
        new int[]{14, 3},
        new int[]{12, 3},
        new int[]{4, 2},
        new int[]{3, 0},
        new int[]{4, 2},
        new int[]{3, 0},
        new int[]{2, 1},
        new int[]{11, 3},
        new int[]{2, 1},
        new int[]{1, 2},
        new int[]{5, 0},
        new int[]{4, 0},
        new int[]{5, 0},
        new int[]{4, 0},
        new int[]{4, 3},
        new int[]{14, 0},
        new int[]{4, 3},
        new int[]{2, 2},
        new int[]{5, 0},
        new int[]{4, 0},
        new int[]{5, 0},
        new int[]{4, 0},
        new int[]{4, 3},
        new int[]{14, 0},
        new int[]{4, 3},
        new int[]{2, 2},
        new int[]{4, 2},
        new int[]{3, 0},
        new int[]{4, 2},
        new int[]{3, 0},
        new int[]{14, 3},
        new int[]{13, 3},
        new int[]{14, 3},
        new int[]{12, 3},
        new int[]{4, 2},
        new int[]{3, 0},
        new int[]{4, 2},
        new int[]{3, 0},
        new int[]{2, 1},
        new int[]{11, 3},
        new int[]{2, 1},
        new int[]{1, 2},
        new int[]{4, 1},
        new int[]{2, 3},
        new int[]{4, 1},
        new int[]{2, 3},
        new int[]{3, 1},
        new int[]{12, 0},
        new int[]{3, 1},
        new int[]{1, 3},
        new int[]{4, 1},
        new int[]{2, 3},
        new int[]{4, 1},
        new int[]{2, 3},
        new int[]{3, 1},
        new int[]{12, 0},
        new int[]{3, 1},
        new int[]{1, 3},
        new int[]{14, 2},
        new int[]{11, 1},
        new int[]{14, 2},
        new int[]{11, 1},
        new int[]{13, 2},
        new int[]{9, 1},
        new int[]{13, 2},
        new int[]{7, 3},
        new int[]{14, 2},
        new int[]{11, 1},
        new int[]{14, 2},
        new int[]{11, 1},
        new int[]{12, 2},
        new int[]{8, 1},
        new int[]{12, 2},
        new int[]{6, 3},
        new int[]{4, 1},
        new int[]{2, 3},
        new int[]{4, 1},
        new int[]{2, 3},
        new int[]{3, 1},
        new int[]{12, 0},
        new int[]{3, 1},
        new int[]{1, 3},
        new int[]{4, 1},
        new int[]{2, 3},
        new int[]{4, 1},
        new int[]{2, 3},
        new int[]{3, 1},
        new int[]{12, 0},
        new int[]{3, 1},
        new int[]{1, 3},
        new int[]{2, 0},
        new int[]{1, 0},
        new int[]{2, 0},
        new int[]{1, 0},
        new int[]{11, 2},
        new int[]{7, 0},
        new int[]{11, 2},
        new int[]{6, 0},
        new int[]{2, 0},
        new int[]{1, 0},
        new int[]{2, 0},
        new int[]{1, 0},
        new int[]{1, 1},
        new int[]{6, 1},
        new int[]{1, 1},
        new int[]{0, 0}
    };

    public static boolean[] toBinary(int num, int qtd) {
        boolean[] bits = new boolean[qtd];
        for (int i = bits.length - 1; i >= 0; i--)
            bits[bits.length - i - 1] = (num & (1 << i)) != 0;
        return bits;
    }

    public static int toInteger(boolean[] a) {
        int n = 0, l = a.length;
        for (int i = 0; i < l; ++i)
            n = (n << 1) + (a[i] ? 1 : 0);
        return n;
    }
}